package cn.xinfei.xdecision.common.dao.component.scorecard;

import cn.xinfei.xdecision.common.model.component.ComponentVo;
import cn.xinfei.xdecision.common.model.component.dependency.resp.DecisionComponentDependencyResp;
import cn.xinfei.xdecision.common.model.component.guiderule.vo.RuleListReqVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.xinfei.xdecision.common.model.component.scorecard.Scorecard;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * ClassName:ScordcardMapper </br>
 * Description:评分卡mapper
 * @see
 * */
public interface ScorecardMapper extends BaseMapper<Scorecard> {

	/**
	 * 通过变量code集合查询组件code
	 *
	 * @param values 变量code集合
	 */
	List<DecisionComponentDependencyResp> getComponentCodeByVarCodes(List<String> values);

	/**
	 * getScorecardList:(获取评分卡集合)
	 *
	 * @param  paramMap 参数集合
	 * @return 评分卡集合
	 * */
	public List<Scorecard> getScorecardList(Map<String, Object> paramMap);

	/**
	 * checkByField:(查找引用了某些字段的评分卡集合)
	 *
	 * @param  paramMap 参数集合
	 * @return 评分卡集合
	 * */
	public List<Scorecard> checkByField(Map<String, Object> paramMap);

	void logicalDeleteScorecards(@Param("scorecardIds")List<Long> scorecardIds);

	List<Long> selectIdsByFolderId(@Param("folderId") Long folderId);

	/**
	 * 通过组件code和versionNo集合查询变量code
	 *
	 * @param componentVoList 组件code和versionNo集合
	 */
	List<String> getFieldCodesByConditions(List<ComponentVo> componentVoList);

	List<ComponentVo> pageComponentInfoByCon(RuleListReqVo ruleListReqVo);
}
